import { useSessionStorage } from '@mantine/hooks';
import React from 'react';
import { ThemeContext } from './themes/ThemeProvider';

export const useTheme = () => {
  const ctx = React.useContext(ThemeContext);
  const [themeSwitch, setThemeSwitch] = useSessionStorage({
    key: 'themeSwitch',
    defaultValue: true,
  });
  return {
    theme: ctx.themeValue,
    themeSwitch,
    setThemeSwitch,
  };
};
// export default useTheme
